﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLayer;

public partial class Administrator_CategoryManager : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnNew_Click(object sender, EventArgs e)
    {
        Response.Redirect("CategoryEdit.aspx?cmd=new");
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case "Delete":
                Category.Delete(e.CommandArgument.ToString());
                Response.Redirect("CategoryManager.aspx");
                break;
            case "Edit":
                Response.Redirect("CategoryEdit.aspx?cmd=edit&Id=" + Convert.ToInt32(e.CommandArgument.ToString()));
                break;
        }
    }
}